<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        // 数组转换为字符串 
        /* 
            1. toString() 将数组转化为字符串，用 逗号切割
            2. join(分隔符)
        
        */
        var arr = [1, 2, 3, 4, 5];
        var arr1 = ['郑州', '开封', '洛阳'];
        console.log(arr.toString());
        console.log(arr1.toString());
        console.log('-------------------------');
        console.log(arr.join('-'));
        console.log(arr.join('|'));
        console.log(arr.join('&'));
    </script>
</head>

<body>

</body>

</html>